package com.resource.enums;

public enum TicketChannelEnum {
	/**
	 * 工单来源
	 */
	TICKET_CENTER(0, "工单中心"), PC_MESSAGE(1, "PC客户留言"), H5_MESSAGE(2, "H5客户留言"), WECHAT_MESSAGE(3,
			"微信公众号客户留言"), APP_MESSAGE(4, "APP客户留言"), PC_ONLINE(6, "PC-在线工作台"), CUSTOMER_CENTER(7, "客户中心"), CALL_CENTER(
					8, "呼叫中心"), WECHAT_ONLINE(9, "微信公众号-在线工作台"), H5_ONLINE(10, "H5-在线工作台"), APP_ONLINE(11,
							"APP-在线工作台"), EMAIL_MESSAGE(12, "邮件留言"), VOICE_MESSAGE(13, "语音留言"), WECHAT_SMALL_ONLINE(14,
									"微信小程序-在线工作台"), COMPANY_WECHAT_ONLINE(15, "企业微信-在线工作台"), WECHAT_SMALL_MESSAGE(16,
											"微信小程序客户留言"), COMPANY_WECHAT_MESSAGE(17, "企业微信客户留言");

	private Integer code;

	private String value;

	TicketChannelEnum(Integer code, String value) {
		this.code = code;
		this.value = value;
	}

	public static String getValue(Integer code) {
		TicketChannelEnum[] carTypeEnums = values();
		for (TicketChannelEnum carTypeEnum : carTypeEnums) {
			if (carTypeEnum.code().equals(code)) {
				return carTypeEnum.value();
			}
		}
		return null;
	}

	public static Integer getCode(String value) {
		TicketChannelEnum[] carTypeEnums = values();
		for (TicketChannelEnum carTypeEnum : carTypeEnums) {
			if (carTypeEnum.value().equals(value)) {
				return carTypeEnum.code();
			}
		}
		return null;
	}

	private Integer code() {
		return this.code;
	}

	private String value() {
		return this.value;
	}
}
